///////////////  comments  //////////////////

#ifndef __H_VEDIT_HANDLER
#define __H_VEDIT_HANDLER

#include <string>
#include "combined.h"
#include "definitions.h"
#include "tEditHandler.h"

class tEditHandler {
	protected:
		// Protected data...
		Character*		_c;
		std::string*	_dest;
		std::string		_lines[40];
		unsigned		_nLines;

		// Protected methods...
		void	update();

	public:
		// Constructors...
		tEditHandler();
		tEditHandler( Character*, std::string* );
		~tEditHandler();

		// Operators...
		tEditHandler& operator = ( tEditHandler& );

		// Public accessor methods...
		void			setCharacter( Character* character );
		Character*		getCharacter();
		void			setDest( std::string* dest );
		std::string*	getDest();
		std::string		getLine( const unsigned& u );
		void			setLine( const unsigned& u, const std::string& value );
		void			addLine( const std::string& );
		void			insertLine( const std::string& value );
		void			removeLine( const std::string& value );
		void			replaceLine( const std::string& value );
		unsigned		getNlines();

		// General methods...
		std::string		editWindow();
};


///////////////////////////////////////////////  tEditList  ///////////////////////////////////////////////

class tEditList {
	protected:
		// Protected data...
		std::list< tEditHandler* > _vList;

	public:
		// Constructors...

		// Operators...

		// Public accessor methods...
		std::list< tEditHandler* >&	getList();
		tEditHandler* 				getHandler( const std::string& name );

		// General methods...
		void	add( tEditHandler* handler );
		void	act( Character* character, const std::string& input );
		static tEditList& Instance();
};

// Our singleton instance...
inline tEditList& tEditList::Instance() {
	static tEditList _instance;
	return _instance;
}



#endif // #ifndef __H_VEDIT_HANDLER
